import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '学/工号',
    align:"center",
    dataIndex: 'personCode'
  },
  {
    title: '姓名',
    align:"center",
    dataIndex: 'personName'
  },
  {
    title: '照片',
    align:"center",
    dataIndex: 'personPhoto',
    slots: { customRender: 'infoSlot' },
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '学号',
    field: 'personCode',
    component: 'Input',
  },
  {
    label: '姓名',
    field: 'personName',
    component: 'Input',
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: 'box人员id',
    field: 'boxPersonId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入box人员id!'},
          ];
     },
  },
  {
    label: '人员id',
    field: 'ssPersonId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入人员id!'},
          ];
     },
  },
  {
    label: '描述',
    field: 'remark',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  boxPersonId: {title: 'box人员id',order: 0,view: 'text', type: 'string',},
  ssPersonId: {title: '人员id',order: 1,view: 'text', type: 'string',},
  remark: {title: '描述',order: 2,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
